package com.school.course; // 课程类单独放course包

import com.school.entity.Teacher; // 跨包关联Teacher类

public class Course {
    // 私有属性：仅本类可直接访问，外部通过Getter获取
    private String courseId;
    private String courseName;
    private String location;
    private String time;
    private int credit;
    private Teacher teacher; // 关联Teacher（父类Person的子类）

    // 构造方法
    public Course(String courseId, String courseName, String location, String time, int credit, Teacher teacher) {
        this.courseId = courseId;
        this.courseName = courseName;
        this.location = location;
        this.time = time;
        this.credit = credit;
        this.teacher = teacher;
    }

    // 全Getter（跨包访问时，必须public修饰方法）
    public String getCourseId() { return courseId; }
    public String getCourseName() { return courseName; }
    public String getLocation() { return location; }
    public String getTime() { return time; }
    public int getCredit() { return credit; }
    public Teacher getTeacher() { return teacher; }
}